package com.lazy.book.service.generator;

import com.lazy.book.common.entity.PageResult;
import com.lazy.book.pojo.generator.dto.DbTableQueryDTO;
import com.lazy.book.pojo.generator.dto.ImportTableDTO;
import com.lazy.book.pojo.generator.dto.SelectTablesDTO;
import com.lazy.book.pojo.generator.po.GeneratorTable;
import com.lazy.book.pojo.generator.vo.GenCheckedInfoVO;
import com.lazy.book.pojo.generator.vo.GeneratorDetailVO;
import com.lazy.book.pojo.generator.vo.GeneratorPreviewVO;
import com.mybatisflex.core.service.IService;
import freemarker.template.Template;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;

/**
 *
 * @author lazy
 * @since 2025-09-05
 */
public interface GeneratorTableService extends IService<GeneratorTable> {

  void importTable(ImportTableDTO dto);

  PageResult<GeneratorTable> selectDbTableNotInImport(DbTableQueryDTO dto);

  PageResult<GeneratorTable> selectDbTableByImport(DbTableQueryDTO dto);

  GeneratorDetailVO detail(String tableName);

  void updateGeneratorSetting(GeneratorDetailVO generatorDetailVO);

  List<String> generator(String tableName) throws IOException;

  GenCheckedInfoVO checkDist(String tableName);

  byte[] downloadZip(SelectTablesDTO dto) throws IOException;

  List<GeneratorPreviewVO> preview(String tableName) throws IOException;

  Template getMenuSqlTemplate() throws IOException;

  @Transactional
  void remove(SelectTablesDTO dto);

  Template getDictSqlTemplate() throws IOException;
}
